package com.leafsaas.controller;

import com.leafsaas.snowflake.SnowflakeIdWorker;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 *
 * @author houxifeng
 * @date 2025/11/4
 */
@RestController
@RequestMapping("/snow")
public class SnowflakeController {

    private final SnowflakeIdWorker snowflakeIdWorker = new SnowflakeIdWorker(1, 1);

    @GetMapping("/next")
    public Map<String, Long> next() {
        return Map.of("id", snowflakeIdWorker.nextId());
    }


}
